<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\Index\IndexController;
use App\Http\Controllers\Guard\User\UserController;
use App\Http\Controllers\Guard\Dev\DevInfoController;
use App\Http\Controllers\Guard\Dev\DevTypeController;
use App\Http\Controllers\Guard\Dev\DevLogController;
use App\Http\Controllers\Guard\Dev\AreaController;
use App\Http\Controllers\Guard\Setting\SysSettingController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/getToken',[LoginController::class,'getToken']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);

Route::post('/importFile',[LoginController::class,'importFile']);

//设备管理
Route::group(['prefix'=>'dev'],function(Router $router){

    $router->get('/lst',[DevInfoController::class,'lst']);
    $router->get('/del',[DevInfoController::class,'del']);
    $router->get('/change',[DevInfoController::class,'change']);
    $router->get('/detail',[DevInfoController::class,'detail']);
    $router->get('/getQr',[DevInfoController::class,'qr']);
    $router->post('/add',[DevInfoController::class,'add']);

    $router->get('/log/lst',[DevLogController::class,'lst']);
    $router->get('/log/del',[DevLogController::class,'del']);
    $router->post('/log/add',[DevLogController::class,'add']);


    $router->get('/type/business',[DevTypeController::class,'business']);
    $router->get('/type/lst',[DevTypeController::class,'lst']);
    $router->get('/type/detail',[DevTypeController::class,'detail']);
    $router->get('/type/change',[DevTypeController::class,'change']);
    $router->get('/type/del',[DevTypeController::class,'del']);
    $router->post('/type/add',[DevTypeController::class,'add']);


});
//位置管理
Route::group(['prefix'=>'area'],function(Router $router){

    $router->get('/lst',[AreaController::class,'lst']);
    $router->get('/detail',[AreaController::class,'detail']);
    $router->get('/del',[AreaController::class,'del']);
    $router->get('/getAreaMap',[AreaController::class,'getAreaMap']);
    $router->post('/add',[AreaController::class,'add']);
});


//rbac权限管理
Route::group(['prefix'=>'rbac'],function(Router $router){

    $router->get('/getGuardUser',[IndexController::class,'getGuardUser']);
    $router->get('/loginLog',[IndexController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/detail',[PermissionController::class,'detail']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/detail',[RoleController::class,'detail']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/detail',[GuardUserController::class,'detail']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->post('/guardUser/edit',[GuardUserController::class,'edit']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);


});

//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/del',[UserController::class,'del']);
    $router->match(['get','post'],'/add',[UserController::class,'add']);

});

//系统设置
Route::group(['prefix'=>'setting'],function(Router $router){

    $router->match(['get','post'],'/sys/index',[SysSettingController::class,'index']);

});






